home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9398 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  54 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.sprintlink.net!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: [Help!] "Declaration syntax error" on interrupt program ?
  5. Message-ID: <DnE06H.Dnp@mv.mv.com>
  6. Mime-Version: 1.0
  7. Organization: GSSI
  8. Date: Mon, 26 Feb 1996 14:27:53 GMT
  9. References: <4gq1mk$8bl@jaring.my>
  10. X-Newsreader: WinVN 0.93.10
  11. X-Nntp-Posting-Host: gssi.mv.com
  12.  
  13. In article <4gq1mk$8bl@jaring.my>, yinchau@pl.jaring.my says...
  14. >
  15. >Below is an example program from the Turbo C++ 3.0 Online Help.
  16. >However when I run the program, an error message appeared at line
  17. >"#####" stating that there is some "declaration syntax error" that I
  18. >failed to find out.
  19. >
  20. >Can anyone help me with my first involvement in "interrupts".  TQ.
  21. >
  22. >___________________________________________________
  23. >
  24. >#include  <dos.h>
  25. >#include  <conio.h>
  26. >
  27. >void interrupt (*mybeep)( void )
  28. >{                                                             #####
  29. >  int      i, j;
  30.  
  31. You are just declared variable "mybeep" as pointer to some function. And 
  32. after
  33. that you place body of function like if it is a real function definition - 
  34. not just declaration of pointer - it is invalid. You can write:
  35.  
  36.   void interrupt (*mybeep)( void );  // This is a pointer to some function
  37.  
  38.     or (probably that is what you need):
  39.  
  40.   void interrupt mybeep( void )      // This is a definition of function
  41.     {
  42.     int    i, j
  43.      .............
  44.     }
  45.  
  46. <<< If you received it by E-mail: it is a copy of post to the newsgroup >>>
  47. ---------------------------------------------------------------
  48. Michael Furman,                       (603)893-1109
  49. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  50. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  51. North Salem, NH 03073-0097            71543.1334@compuserve.com
  52. ---------------------------------------------------------------
  53.  
  54.